<template>
	<view class="page"> 
		<view class="topContent">
			<view class="addressInfo" v-if="isAddress==1">
				<view class="addressIcon">
					<image src="../../../static/images/other/address.png" mode="widthFix"></image>
				</view>
				<view class="box">
					<view class="name">
						{{addressObj.username ? addressObj.username : addressObj.realname }}<text>{{addressObj.mobile}}</text>
					</view>
					<view class="address" v-if="!addressObj.address">
						{{addressObj.province ? addressObj.province : '' }}{{addressObj.district ? addressObj.district : ''}}{{addressObj.city ? addressObj.city : ''}}{{addressObj.address ? addressObj.address : ''}}
					</view>
					<view class="address" v-if="addressObj.address">
						{{addressObj.province ? addressObj.province : '' }}{{addressObj.district ? addressObj.district : ''}}{{addressObj.city ? addressObj.city : ''}}{{addressObj.address ? addressObj.address : ''}}
					</view>
				</view>
			
				<u-icon name="arrow-right" v-if="type == 0" @click="junit('/pages/prefile/address/list')" ></u-icon>
				
			</view>
			<view class="addressInfo" style="justify-content: center;" v-if="isAddress==0">
				<view class="emptyText" @click="junit('/pages/prefile/address/list')">您还未完善收件信息，点击去完善>></view>
			</view>
			<view class="boxItem">
				<!-- 预下单中 -->
				<view  v-if="type == 0 && orderObj.orders">
					<view  class="shopInfo" v-for="(item,index) in orderObj.orders[0].order_goods" :key="index">
						<image :src="item.thumb" mode="widthFix"></image>
						<view class="box">
							<view class="shop-name" style="font-weight: 600;">
								{{item.title}} <text  style="font-weight: 400;margin-left: 20rpx;color: #999999;">{{item.goods_option_title}}</text>
							</view>
							<view class="rowItem" v-if="shopType != 2">
								<text style="color:#E9622B;margin-right: 40rpx;">¥{{item.price}}</text>
								<text>x{{item.total}}</text>
							</view>
						</view>
					</view>
				</view>
				
				
				<!-- 订单详情  已下单-->
				<view   v-if="type == 1  && orderObj.has_many_order_goods" >
					<view class="shopInfo" v-for="(item,index) in orderObj.has_many_order_goods" :key="index">
						<image :src="item.thumb" mode="widthFix"></image>
						<view class="box">
							<view class="shop-name" style="font-weight: 600;">
								{{item.title}} <text  style="font-weight: 400;margin-left: 20rpx;color: #999999;">{{item.goods_option_title ? item.goods_option_title : '' }}</text>
							</view>
							<view class="rowItem" v-if="shopType != 2">
								<text style="color:#E9622B;">¥{{item.price}}</text>
								<text>x{{item.total}}</text>
							</view>
						</view>
					</view>
				</view>
				
				
				<view v-if="type != 0">
					<view class="rowItem">
						<text>{{'订单编号'}}</text>
						<text>{{orderObj.order_sn}}</text>
					</view>
					<view class="rowItem">
						<text>{{'交易状态'}}</text>
						<text>{{orderObj.status_name}}</text>
					</view>
					<view class="rowItem">
						<text>{{'支付方式'}}</text>
						<text>{{orderObj.pay_type_name}}</text>
					</view>
				</view>
				<!-- 下单后  end-->
				
				
			</view>
			
			
			<view class="boxItem"  v-if="type == 0 && proxyObj.show ">
					<view class="rowItem" @click="proxyFromShow">
						<text style="font-weight: 600;color: #111;"> 代理区域</text>
						<view  style="color: #B5B5B5;">{{ proxyObj.formValObj ? '已填写' : '未填写'}} <u-icon name="arrow-right"></u-icon> </view>
					</view>
					<!-- <u-select v-model="couponShow" :list="couponsArr"  @confirm="couponConfirm"></u-select> -->
			</view>
			
			<view class="boxItem" >
				<view class="" v-if="type == 0 && couponsArr.length">
				 	<view class="rowItem" @click="couponShow=true">
				 		<text style="font-weight: 600;color: #111;">优惠券 {{couponsArr.length}} 张可用</text>
				 		<view style="color: #B5B5B5;">{{ couponsObj ? '已选中' + couponsObj.label : '未选中'}} <u-icon name="arrow-right"></u-icon> </view>
				 	</view>
				</view>
				<u-select v-model="couponShow" :list="couponsArr"  @confirm="couponConfirm"></u-select>
				
				<view class="rowItem" style="position: relative;" v-if="type == 0 && shopType == 2 && usable_coin">
					<view class="rowItemLeft">
						<text style="font-weight: 600;color: #111;">可用{{usable_coin}}积分抵扣</text>
					</view>
					<u-switch v-model="duihuanChecked" active-color="#ea692e" @change="duihuanCheckedChange()"></u-switch>
				</view>
				<view class="rowItem" style="position: relative;" v-if="type == 0 && shopType == 2 && !usable_coin">
					<view class="rowItemLeft">
						<view class="tipsText">您当前拥有的积分不足以抵扣</view>
					</view>
				</view>
				
			</view>
			
			<view class="boxItem"  v-if="type == 0">
					<view class="rowItem" v-for="(item,index) in orderObj.amount_items" :key="index">
						<text>{{item.name}}</text>
						<text style="color: #E95F2A;">{{item.name=='总抵扣' ? '-' :''}}{{ item.name=='石榴籽' ? '' : '￥'}}{{item.amount}}</text>
					</view>
					<!-- 优惠金额 -->
					<view class="rowItem" v-for="(item,index) in orderObj.discount_amount_items" :key="index">
						<text>{{item.name}}</text>
						<text style="color: #E95F2A;">-￥{{item.amount}}</text>
					</view>
			</view>
			
			<view class="boxItem"  v-if="type != 0">
					<view class="rowItem" v-for="(item,index) in orderObj.order_discount" :key="index">
						<text>{{'优惠金额'}}</text>
						<text style="color: #E95F2A;">￥{{item.amount}}</text>
					</view>
					<!-- 优惠金额 -->
					<view class="rowItem" v-for="(item,index) in orderObj.order_deduction" :key="index">
						<text>{{item.name}}</text>
						<text style="color: #E95F2A;">-{{item.coin}}</text>
					</view>
					<view class="tips">
						实付费:<text style="color: #E9622B;">￥{{orderObj.price}}</text>
					</view>
			</view>
			
			
			
			
		</view>
		
		<view class="bottomContent" v-if="type != 0" >
			<text v-if="item.name != '联系客服'"  :class="index ==0 ?'cancel-btn btn' : 'btn' " v-for="(item,index) in orderObj.button_models" :key="index" @click="orderHandle(item.name,orderId)" >{{item.name}}</text>
			<!-- <text class="btn cancel-btn">{{'物流信息'}}</text>
			<text class="btn">{{ '确认收货' }}</text> -->
		</view>
		<view class="bottomTip"  v-if="type == 0">
			<image class="tips" src="../../../static/images/other/tips.png" mode=""></image> 该商品为活动商品，购买后不支持退货退款 
		</view>
		
		<view class="bottomContent" v-if="type == 0"  style="justify-content: space-between;">
			<view class="totoalNum">
				合计： <text>¥{{orderObj.total_price}} </text>
			</view>
			<text class="nextBtn" @click="goPay()">提交订单</text>
		</view>
		
		<!-- <bottomPopup ref="proxyForm">
			<view class="warp">
				<view class="proxyForm">
					
					<view class="formTitle">
						代理表单填写
					</view>
					<view class="formItem"  @click="proxyObj.showSelect = true">
						<text>代理区域</text>
						<view class="input">
							{{proxyObj.area_text}}
							<u-icon name="arrow-right"></u-icon>
						</view>
					</view>
					<view class="formItem" @click="proxyObj.showStreet = true">
						<text>选择街道</text>
						<view class="input">
							{{proxyObj.streetText}}
							<u-icon name="arrow-right"></u-icon>
						</view>
					</view>
					<view class="formItem" @click="proxyObj.showCommunity = true">
						<text>选择社区/村庄</text>
						<view class="input">
							{{proxyObj.CommunityText}}
							<u-icon name="arrow-right"></u-icon>
						</view>
					</view>
					<view class="btn" @click="submitDiyFrom()">
						提交
					</view>
					
					<u-select :list="communityArr" v-model="proxyObj.showCommunity" @confirm="communityConfirm">
					</u-select>
					
					<u-select  :list="streetArr" v-model="proxyObj.showStreet" @confirm="streetConfirm">
					</u-select>
					
					<u-select mode="mutil-column-auto" :list="addressAreaList" v-model="proxyObj.showSelect" @confirm="addressConfirm">
					</u-select>
					
				</view>
			</view>
		</bottomPopup>	 -->
		
		
		
	</view>
</template>

<script>
	import bottomPopup  from "@/components/bottom-popup/bottom-popup.vue"
	export default {
		data() {
			return {
				type: '',//0 未下单订单 !==0 下单
				shopType : '',// 1 普通商品  2 积分兑换 
				addressObj:{},
				orderObj:{},
				orderId:'',
				isAddress: 0,//没有地址
				num : '',
				specificationId: '',
				couponShow : false,
				couponsArr : [],//优惠卷数组
				couponsObj : undefined,//优惠卷
				duihuanChecked : false, 
				pre_id : '',//抵扣id
				usable_coin: '',//可用金额
				usable_amount: '',//抵扣金额
				proxyObj:{
					show : false,
					formObj : {},
					formValObj : undefined,//代理表接口返回的id
					showSelect : false,
					province: '',
					city: '',
					district: '',
					area_text: '',
					detailAdress : '',
					areaId : '',//区
					streetText : '',
					streetId : '',
					showStreet : false,
					showCommunity : false,
					CommunityText : '',
				},//代理对象
				streetArr:[],//街道
				communityArr:[],//社区
				addressAreaList: [
					[],
					[],
					[],
					[]
				],//地址
				// usable_data : '',//石榴籽
			};
		},
		methods:{
	
			// 提交diy表单
			submitDiyFrom(){
				// if(!this.proxyObj.area_text || !this.proxyObj.streetText || !this.proxyObj.CommunityText){
				// 	return uni.showToast({
				// 		title: '请先填写表单信息',
				// 		icon : 'none',
				// 	})
				// }
				console.log(this.proxyObj.formObj);
				let form_data = [
					{ 
						"diydailiquyu":  this.proxyObj.area_text+' ' + this.proxyObj.streetText + ' ' +this.proxyObj.CommunityText,
					    // "diyxiangxidizhi": this.proxyObj.detailAdress
					    "diyxiangxidizhi": ''
					 },
				]
				this.myHttp({
					method: 'POST',
					data:{
						mid: uni.getStorageSync("userInfo").uid,
						uuid: 0 ,
						type: 5,
						route : 'plugin.diyform.api.diy-form.saveDiyFormData',
						form_id : this.proxyObj.formObj.form_id,
						form_data : form_data
					}
				}).then(res=>{
					if(res.result == 1){
					  this.proxyObj.formValObj	= res.data.form_data_id
					  this.$refs.proxyForm.show = false
					  console.log( this.proxyObj.formValObj);
					}
				})
			},
			// 代理表单
			proxyFromShow(){
				if(this.proxyObj.formValObj){
					// 代理表单有值
					this.myHttp({
						url:'/addons/yun_shop/api.php',
						method: 'POST',
						data:{
							mid: uni.getStorageSync("userInfo").uid,
							type: 5,
							route : 'plugin.diyform.api.diy-form.getSingleFormData',
							form_id : this.proxyObj.formObj.form_id ,
							form_data_id: this.proxyObj.formValObj
						}
					}).then((res)=>{
						if(res.result== '1'){
							try{
								let arr = res.data.fields.diydailiquyu.value.split(' ')
								this.proxyObj.area_text = arr[0]
								this.proxyObj.streetText = arr[1] ? arr[1] : ''
								this.proxyObj.CommunityText = arr[2] ? arr[2] : ''
								// this.proxyObj.detailAdress = res.data.fields.diyxiangxidizhi.value
								
							}catch(e){
								//TODO handle the exception
							}
						}
					})
				}
				
				this.$refs.proxyForm.show = true
			},
			// 兑换状态
			duihuanCheckedChange(){
				this.preOrder()
			},
			// 下一步 去支付
			goPay(){
				if(this.type==0){
					// 商品
					let goods = [
						{
							goods_id : this.goodsId,
							total : this.orderObj.orders[0].order_goods[0].total,
							option_id : this.orderObj.orders[0].order_goods[0].goods_option ? this.orderObj.orders[0].order_goods[0].goods_option.id : '',
						}
					]
					
					// 优惠卷
					let member_coupon_ids = []
					if(this.couponsObj && this.couponsObj.value){
						member_coupon_ids.push(this.couponsObj.value)
					}
					
					// 兑换的商品
					let orders = []
					console.log('兑换商品');
					if(this.shopType==2 && this.duihuanChecked == true){
							let arr = [
								{
									// "deduction_ids":["love"],
									"deduction_ids":[],
									"pre_id": this.pre_id,
									// "diyform_data_id": this.proxyObj.formValObj,//diy表单
								}
							]
							// orders = arr
							orders = JSON.stringify(arr) 
							// console.log('赋值完成');
							console.log(orders);
					}
					
					// 如果是代理表单
					let order_goods = []
					if(this.proxyObj.formValObj){
						let arr = [
							{
								"pre_id": this.orderObj.orders[0].order_goods[0].pre_id,
								"diyform_data_id": this.proxyObj.formValObj,//diy表单
							}
						]
						// orders = arr
						order_goods = JSON.stringify(arr) 
					}
					// if(this.proxyObj.show && !this.proxyObj.formValObj){
					// 	return uni.showToast({
					// 		title: '请先填写代理表单信息',
					// 		icon : 'none',
					// 	})
					// }
					
					this.myHttp({
						url:'/addons/yun_shop/api.php',
						method: 'POST',
						data:{
							mid: uni.getStorageSync("userInfo").uid,
							type: 5,
							route : 'order.create',
							address: this.addressObj ?  JSON.stringify(this.addressObj) : '',
							call : '',
							company_number : '',
							dispatch_type_id : 1,
							goods: JSON.stringify(goods),
							invoice_type : 0,
							member_coupon_ids,
							orders ,
							order_goods,
							rise_type : 1,
							form_data_id: this.proxyObj.formValObj
						}
					}).then((res)=>{
						if(res.result== '1'){
							let orderId = res.data.order_ids
							this.$Router.replace({
								path:  `/pages/order/payment/method`,
								query: {
									orderId,
									goodsId: this.goodsId,
									payState: 'paying',
									goodsType: 1,//商品类型 1 普通商品
									isAddress: this.isAddress,
								}
							});
							// this.junit('/pages/order/payment/method' , {})
						}
					})
				}
				// this.junit('/pages/order/payment/method' , {})
			},
			// 获取地址
			getAddress(againEditAdress){
				this.myHttp({
					url:'/addons/yun_shop/api.php',
					data:{
						uuid: 0,
						mid: uni.getStorageSync("userInfo").uid,
						shop_id : '',//参团id
						route : 'member.member-address.index',
					}
				}).then((res)=>{
					if(res.result== '1'){
						if(res.data.length){
							res.data.forEach((item)=>{
								if(item.isdefault==1){
									this.addressObj = item
								}
							})
						}
						this.preOrder()
					
						
					}
				})
			},
			// 修改地址
			editOrderAdress(_addressObj){
				let addressData = {
					"order_id": this.orderId, //订单id
					"realname": _addressObj.username, //姓名
					"phone": _addressObj.mobile, //手机号
					"province_id": _addressObj.province_id, //省id
					"city_id": _addressObj.city_id, //市id
					"district_id": _addressObj.district_id ? _addressObj.district_id :'', //镇区id
					"street_id": _addressObj.street_id? _addressObj.street_id : '', //街道id
					"address": _addressObj.address //详细地址
				}
				this.myHttp({
					method: 'POST',
					data:{
						"route" : 'order.address-update.update',
						"data" : addressData
					}
				}).then(res=>{
					if(res.result== '1'){
						console.log('修改地址成功');
					}
				})
			},
			// 预下单
			preOrder(){
				// 兑换的商品
				let orders 
				if(this.shopType==2 && this.duihuanChecked == true){
						let arr = [
							{
								// "deduction_ids":["love"],
								"deduction_ids": [],
								"pre_id": this.pre_id,
							}
						]
						// orders = arr
						orders = JSON.stringify(arr)
						console.log('赋值完成');
						console.log(orders);
				}
				
				this.myHttp({
					url:'/addons/yun_shop/api.php',
					data:{
						uuid: 	0,
						mid: uni.getStorageSync("userInfo").uid,
						type: 5,
						shop_id : '',
						route : 'order.goods-buy',
						goods_id: this.goodsId,
						total: this.num ? this.num : 1,
						option_id : this.specificationId ? this.specificationId : '',
						member_coupon_ids: this.couponsObj ?  this.couponsObj.value : '',
						orders ,
						address : this.addressObj ? JSON.stringify(this.addressObj)  : '',
						dispatch_type_id : 1,
						mark : 0,
					},
					contentType: 'form-data',
				}).then((res)=>{
					if(res.result== '1'){
						this.orderObj = res.data
						// console.log('优惠卷');
						if(this.orderObj.discount.member_coupons.length){
							this.couponsArr = this.orderObj.discount.member_coupons
							this.couponsArr.forEach(item=>{
								item.label = item.belongs_to_coupon.name+'优惠卷'
								item.value = item.id
							})
						}
						// 可兑换的数值
						try{
							let valObj = this.orderObj.orders[0].order_deductions[0]
							this.usable_coin = valObj.coin
							this.usable_amount = valObj.amount
							this.pre_id = this.orderObj.orders[0].pre_id
							console.log('this.pre_id='+this.pre_id)
							if(this.orderObj.amount_items[0].name == '订单总金额'){
								this.orderObj.amount_items.splice(0,1)
							}
							
						}catch(e){
							//TODO handle the exception
						}
						
						// 是否显示代理
						if(this.orderObj.orders[0].order_goods[0].diy_form){
							// console.log('控制代理');
							this.proxyObj.show = true
							this.proxyObj.formObj = this.orderObj.orders[0].order_goods[0].diy_form
							
						}
						// 地址
						if(this.orderObj.dispatch.default_member_address){
							this.isAddress = 1
							this.addressObj = this.orderObj.dispatch.default_member_address
						}
						
						
					}
				})
			},
			// 获取已下单订单详情
			getOrderDetail(order_id){
				this.myHttp({
					url:'/addons/yun_shop/api.php',
					data:{
						order_id ,
						route : 'order.detail',
					}
				}).then(res=>{
					if(res.result== '1'){
						this.orderObj = res.data
					
						if( this.orderObj.address_info.constructor == Array){
								this.isAddress = 0
						}
						// 兑换商品
						try{
							if(this.orderObj.order_deduction[0].name== '积分'){
								this.shopType = 2
								
							}
							
						}catch(e){
						}
						if(this.orderObj.address_info && this.orderObj.address_info.constructor != Array){
							this.isAddress = 1
							this.addressObj = this.orderObj.address_info
						}
					
						
						
					}
				})
			},
			// 订单按钮处理
			orderHandle(_btnName,_orderId){
				console.log(_orderId);
				if(_btnName=='取消订单'){
					this.cancelOrder(_orderId)
				}else if(_btnName=='支付'){
				
					this.$Router.replace({
						path:  `/pages/order/payment/method`,
						query: {
							orderId : _orderId,
							payState: 'paying',
							goodsType: 1,//商品类型 1 普通商品
							// isAddress: this.isAddress,
						}
					});
				}else if(_btnName=='物流信息'){
					this.$Router.push({path: '/pages/prefile/express-list/express-list', query: {id: _orderId}})
				}else if(_btnName=='确认收货'){
					this.confirmOrder(_orderId)
				}else if(_btnName=='删除订单'){
					this.deleteOrder(_orderId)
				}
			},
			// 订单列表删除订单
			deleteOrder(_id){
				let that = this
				uni.showModal({
				    title: '提示',
				    content: '确认删除订单？',
				    success: function (res) {
				        if (res.confirm) {
				            that.myHttp({
				            	url:'/addons/yun_shop/api.php',
				            	data : {
				            		route: 'order.operation.delete',
				            		order_id : _id
				            	}
				            }).then(res=>{
				            	if(res.result== 1){
				            		uni.showToast({
				            		    title: '删除成功',
				            		    duration: 3000,
				            		    icon: 'success'
				            		});
									that.goBack()
				            	}
				            })
				        } else if (res.cancel) {
							return
				        }
				    }
				});
				
			},
			// 订单列表取消订单
			cancelOrder(_id){
				let that = this
				uni.showModal({
				    title: '提示',
				    content: '确认取消订单？',
				    success: function (res) {
				        if (res.confirm) {
				           that.myHttp({
				           	url:'/addons/yun_shop/api.php',
				           	data : {
				           		route: 'order.operation.close',
				           		order_id : _id
				           	}
				           }).then(res=>{
				           	if(res.result== 1){
				           		uni.showToast({
				           		    title: '取消成功',
				           		    duration: 3000,
				           		    icon: 'success'
				           		});
								that.goBack()
				           	}
				           })
				        } else if (res.cancel) {
							return
				        }
				    }
				});
			},
			// 订单列表确认收货
			confirmOrder(_id){
				let that = this
				uni.showModal({
				    title: '提示',
				    content: '确认订单收货？',
				    success: function (res) {
				        if (res.confirm) {
				          that.myHttp({
				          	url:'/addons/yun_shop/api.php',
				          	data : {
				          		route: 'order.operation.receive',
				          		order_id : _id
				          	}
				          }).then(res=>{
				          	if(res.result== 1){
				          		uni.showToast({
				          		    title: '收货成功',
				          		    duration: 1500,
				          		    icon: 'success'
				          		});
								that.goBack()
				          	}
				          })
				        } else if (res.cancel) {
							return
				        }
				    }
				});
			},
			// 确认优惠券
			couponConfirm(e){
				console.log(e);
				this.couponsObj = e[0]
				this.preOrder()
			},
			// 获取表单地址
			getAddressColunm() {
				this.$http.get('user.getCity').then(res => {
					this.addressAreaList = this.$tools.addressToTree(res.data);
				})
			},
			communityConfirm(e){
				this.proxyObj.CommunityText = e[0]['label']
			},
			streetConfirm(e){
				this.proxyObj.streetText = e[0]['label']
				this.proxyObj.streetId = e[0]['value']
				this.proxyObj.CommunityText = ''
				this.myHttp({
					data:{
						route: 	'member.memberAddress.getAddress' 	,
						ingress :	'weChatApplet' 	,
						state: 	'village',
						parentid :	this.proxyObj.streetId,
					}
				}).then(res=>{
					if(res.length){
						this.communityArr = []
						res.forEach(item=>{
							let obj={
								label: item.areaname ,
								value: item.id
							}
							this.communityArr.push(obj)
						})
					}
				})
			},
			addressConfirm(e) {
				console.log(e);
				this.proxyObj.province = e[0]['label'];
				this.proxyObj.city = e[1]['label'];
				this.proxyObj.district = e[2]['label'];
				this.proxyObj.areaId = e[2]['value'];
				this.proxyObj.area_text = `${this.proxyObj.province}-${this.proxyObj.city}-${this.proxyObj.district}`;
				this.proxyObj.streetText =''
				this.proxyObj.streetId = ''
				this.proxyObj.CommunityText = ''
				this.myHttp({
					data:{
						route: 	'member.memberAddress.getAddress' 	,
						ingress :	'weChatApplet' 	,
						state: 	'street',
						parentid :	this.proxyObj.areaId,
					}
				}).then(res=>{
					if(res.length){
						this.streetArr = []
						res.forEach(item=>{
							let obj={
								label: item.areaname ,
								value: item.id
							}
							this.streetArr.push(obj)
						})
					}
				})
				
				console.log(this.proxyObj);
			},
			
		},
		onLoad({type,shopType,goodsId,orderId,specificationId,num}) {
			if(type){
				this.type = type
			}
			if(shopType){
				this.shopType = shopType
				// this.shopType==2 ? this.duihuanChecked = true : ''
			}
			if(goodsId){
				console.log(`goodsId=`+goodsId);
				this.goodsId = goodsId
			}
			if(orderId){
				this.orderId = orderId
			}
			if(specificationId){
				this.specificationId = specificationId
			}
			if(num){
				this.num = num
			}
		},
		async onShow() {
			let that = this
		
			// console.log(`this.type=`+this.type);
			if(this.type == 0){
				uni.$on('SELECT_ADDRESS', function(data){
				    that.addressObj =  JSON.parse( data.addressData);
					that.isAddress = 1
					// that.editOrderAdress(that.addressObj)
				})
				// 未支付
				this.getAddress()
				// this.getAddressColunm()
			}else if(this.type == 1){
					uni.$on('SELECT_ADDRESS', function(data){
						console.log('SELECT_ADDRESS');
					    that.addressObj =  JSON.parse( data.addressData);
						console.log( that.addressObj);
						that.isAddress = 1
						let againEditAdress = true
						that.editOrderAdress(that.addressObj)
					})
					this.orderId = this.$Route.query.orderId
					this.getOrderDetail(this.orderId)
			}
		},
		components:{
			bottomPopup
		}
	}
</script>

<style lang="scss" scoped>
	.rowItemLeft{
		height: 80%;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		.tipsText{
			color: #C0C0C0;
		}
	}

	.warp {
			display: flex;
			align-items: flex-end;
			justify-content: center;
			height: 100%;
		}
	
	.proxyForm{
		display: flex;
		flex-direction: column;
		align-items: center;
		height: 700rpx;
		width: 700rpx;
		background-color: #fff;
		.formTitle{
			height: 80rpx;
			font-size: 36rpx;
			font-weight: 600;
			display: flex;
			align-items: center;
			color: #000;
		}
		.formItem{
			width: 95%;
			height: 104rpx;
			background: #F6F6F6;
			border-radius: 10rpx;
			padding: 0 24rpx;
			display: flex;
			align-items: center;
			margin-top: 30rpx;
			text{
				font-size: 29rpx;
				color: #000;
				font-weight: 600;
			}
			.input{
				flex: 1;
				padding: 40rpx;
				display: flex;
				align-items: center;
				justify-content: flex-end;
			}
		}
		.btn{
			margin-top: 50rpx;
			width: 95%;
			height: 76rpx;
			background: linear-gradient(98deg, #E95E2A, #F0953E);
			border-radius: 38rpx;
			display: grid;
			place-items : center;
			font-size: 30rpx;
			color: #fff;
		}
	}
	
</style>
<style lang="scss" scoped>
	.page{
		background-color: #F3F3F3;
		height: 100vh;
		display: flex;
		flex-direction: column;
		.topContent{
			flex: 1;
			.addressInfo{
				height: 150rpx;
				display: flex;
				align-items: center;
				// flex-direction: column;
				// justify-content: center;
				font-size: 26rpx;
				color: #111;
				background-color: #fff;
				padding: 0 30rpx;
				margin-bottom: 12rpx;
				.emptyText{
					color: 	#F70909;
					font-size: 33rpx;
					font-weight: bold;
				}
				.addressIcon{
					width: 80rpx;
					height: 80rpx;
					margin-right: 34rpx;
					image{
						width: 100%;
					}
				}
				.box{
					flex: 1;
					.name{
						text{
							margin-left: 16rpx;
							color: #9E9E9E;
						}
					}
				}
				
				
			}
			.boxItem{
				background: #fff;
				margin-top: 16rpx;
				.shopInfo{
					display: flex;
					padding: 0 28rpx;
					border-bottom: 2rpx solid #eee;
					height: 243rpx;
					align-items: center;
					image{
						width: 190rpx;
						margin-right: 20rpx;
					}
					.box{
						.shop-name{
							margin-left: 26rpx;
							font-size: 28rpx;
							color: #000000;
							
						}
					}
				}
				
				.tips{
					border-top: 2rpx solid #eee;
					height: 106rpx;
					display: flex;
					align-items: center;
					justify-content: flex-end;
					padding: 0 20rpx;
				}
			}
				
			.rowItem{
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 0 20rpx;
				height: 106rpx;
			}
			
		}
		
		
		
		
	}
	
	.bottomTip{
		display: flex;
		align-items: center;
		padding: 0 26rpx;
		width: 750rpx;
		height: 61rpx;
		background: #FFF5E4;
		color: #D3A24F;
		font-size: 22rpx;
		.tips{
			width: 33rpx;
			height: 33rpx;
			margin-right: 10rpx;
		}
	}
	
	.bottomContent{
		height: 104rpx;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		border-top: 2rpx solid #eee;
		padding-right: 22rpx;
		background-color: #fff;
		
		.totoalNum{
			color: #E95F2A;
			margin: 0 22rpx;
		}
		
		.cancel-btn{
			border: 2rpx solid #000 !important;
			color: #000 !important;
		}
		.btn{
			height: 50rpx;
			display: grid;
			place-items : center;
			margin-left: 40rpx;
			padding: 0rpx 25rpx;
			background: #FFFFFF;
			border: 2rpx solid #FF5113;
			border-radius: 25rpx;
			font-size: 25rpx;
			color:  #FF5113;
		}
		.nextBtn{
			width: 330rpx;
			height: 76rpx;
			background: linear-gradient(98deg, #E95E2A, #F0953E);
			border-radius: 38rpx;
			display: grid;
			place-items : center;
			font-size: 30rpx;
			color: #FFFFFF;
		}
	}
</style>
